package com.qf.day02;

import java.util.Scanner;

/**
 * 会员购物时，根据输入积分的不同享受不同的折扣计算会员购物时获得的折扣输出实付金额会员积分x折扣
 * x< 2000 9折
 * 2000≤x< 4000 8折4000≤x< 8000 7折x≥8000 6折
 */
public class SwithDemo2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入积分");
        double x = scanner.nextDouble();
        System.out.println("请输入元子");
        double rmb = scanner.nextDouble();
        if (x < 2000) {
            x = 2000;
        } else if (x >= 2000 && x < 4000) {
            x = 4000;
        } else if (x >= 4000 && x < 8000) {
            x = 8000;
        } else {
            x = 10000;
        }
        System.out.println(x);
        switch ((int) x) {
            case 2000:
                System.out.println("应付" + (rmb * 0.9) + "元");
                break;
            case 4000:
                System.out.println("应付" + (rmb * 0.8) + "元");
                break;
            case 8000:
                System.out.println("应付" + (rmb * 0.7) + "元");
                break;
            default:

                System.out.println("应付" + (rmb * 0.6) + "元");
                break;
        }
    }
}
